package com.zz.tijian.handle.ratelimiter.annotation;

import com.zz.tijian.handle.ratelimiter.res.DefaultRateLimiterResponseStrategy;
import com.zz.tijian.handle.ratelimiter.res.RateLimiterResponseStrategy;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface DoRateLimiter {
    double permitsPerSecond() default 0D; // 限流许可量
    // 限流返回信息，策略模式
    Class<? extends RateLimiterResponseStrategy> responseStrategy() default DefaultRateLimiterResponseStrategy.class;
}
